<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    * {
      margin: 0;
      padding: 0;
    }

    div {
      /* 转换成行内块元素 */
      /* display: inline-block; */
      width: 300px;
      height: 300px;
    }

    .green {
      background-color: green;
      /* 1、水平方向 */
      /* margin-left: 100px; */
      /* margin-right: 100px; */

      /* 2、垂直方向 */
      /* margin-top: 100px; */
      margin-bottom: 100px;
    }

    .blue {
      background-color: blue;
    }
  </style>
</head>

<body>
  <div class="green"></div><div class="blue"></div>
</body>

</html>